build a text editor in python